package shiqi.SingletonPattern;

public class Singleton {

    //私有化构造函数
    private Singleton() {

    }
    //静态私有自身变量
    private static Singleton singleton = null;

    public static Singleton getInstance() {
        if (singleton == null) {
            singleton = new Singleton();
        }
        return singleton;
    }
}
